package com.bi.exception;

import com.bi.common.ErrorCode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class BusineseException extends RuntimeException{
    private int code;
    private String msg;
    private String decription;

    public BusineseException(ErrorCode errorCode) {
        this(errorCode.getCode(), errorCode.getMsg(), errorCode.getDescription());
    }

    public BusineseException(ErrorCode errorCode, String decription) {
        this(errorCode.getCode(), errorCode.getMsg(), decription);
    }

}
